<?php
/**
 * Create By: PhpStorm
 * User: niechenguang
 * File: GetCircle.php
 * Date: 2017/1/2
 * Time: 23:13
 */

namespace app\api\model\page\note;

use app\api\model\dao\Note;
use app\api\model\dao\NoteReply;
use app\api\model\dao\NoteReplyPraise;
use app\api\model\dao\NoteReplyReply;
use app\api\model\dao\UserAccount;
use app\api\model\data\note\NoteData;
use app\library\Error;
use app\library\Flag;
use app\library\PageBase;
use think\Exception;
use think\Validate;

class ClearNoteReply extends PageBase
{

    private $objNote;
    private $objNoteReply;
    private $objNoteReplyReply;
    private $objNoteReplyPraise;
    private $objUserAccount;
    private $objNoteData;

    public function __construct()
    {
        parent::__construct();

        $this->objNote = new Note();
        $this->objNoteReply = new NoteReply();
        $this->objUserAccount = new UserAccount();
        $this->objNoteReplyReply = new NoteReplyReply();
        $this->objNoteReplyPraise = new NoteReplyPraise();
        $this->objNoteData = new NoteData();
    }

    /**
     * page 入口
     *
     * @param $param
     * @return array
     * @throws Exception
     */
    public function excute($param)
    {
        $ret = $this->checkToken($param);
        if (false === $ret) {
            throw new Exception('check token fail...', Error::ERR_NO_AUTH);
        }

        $this->objNoteReply->clearNoteReply($this->user_id);

        $this->objNoteReplyReply->clear($this->user_id);

        return $this->getRes();
    }

}
